package day05;

public class Person {
    String id;//身份证号
    String name;//姓名
    int age; //年龄
    boolean sex;//性别

    public Person(){
        System.out.println("Person类的无参构造方法被调用");
    }

    public Person(String name){
        System.out.println("一个参数的构造方法");
        this.name = name;
    }

    public Person(String name,int age,boolean sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    }


    public void eat(){
        System.out.println(name+" eat food!");
    }
    public void sleep(){
        System.out.println("sleep");
    }

    @Override
    public String toString() {
        return "Person{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + (sex?"男":"女") +
                '}';
    }
}
